package com.diandian.backend.log.param;

import com.diandian.backend.log.dto.LogRecordAddParamDTO;
import com.diandian.base.boot.starter.exception.DefaultException;

import java.io.Serializable;

public class LogRecordAddParam implements Serializable {

	private String clientId;
	private String businessType;
	private String businessId;
	private String content;
	private String level;

	public void check(){
		if(this.clientId == null || "".equals(this.clientId)){
			throw new DefaultException("客户端ID不能为空");
		}
		if(this.businessType == null || "".equals(this.businessType)){
			throw new DefaultException("业务类型不能为空");
		}
		if(this.content == null || "".equals(this.content)){
			throw new DefaultException("内容不能为空");
		}
	}

	public LogRecordAddParamDTO toDTO(){
		LogRecordAddParamDTO dto = new LogRecordAddParamDTO();
		dto.setClientId(this.clientId);
		dto.setBusinessType(this.businessType);
		dto.setBusinessId(this.businessId);
		dto.setContent(this.content);
		dto.setLevel(this.level);
		return dto;
	}

	public String getClientId() {
		return clientId;
	}
	public String setClientId(String clientId) {
		return this.clientId = clientId;
	}
	public String getBusinessType() {
		return businessType;
	}
	public String setBusinessType(String businessType) {
		return this.businessType = businessType;
	}
	public String getBusinessId() {
		return businessId;
	}
	public String setBusinessId(String businessId) {
		return this.businessId = businessId;
	}
	public String getContent() {
		return content;
	}
	public String setContent(String content) {
		return this.content = content;
	}
	public String getLevel() {
		return level;
	}
	public String setLevel(String level) {
		return this.level = level;
	}
}
